﻿//define(["angular"], function(angular){
	//return 
		angular.module("common", [])
		.filter("limitCharacter", function($filter) {
			//reuse AngularJS filter limitTo and append "..." in case of long text, excluding HTML tags
			return function (text, limit) {
				var plainText = text.replace(/<\/?([^>])+>/g, "");
				if (text && plainText.length > limit) {
					return $filter("limitTo")(plainText, limit) + "&hellip;";
				} else{
					return text;
				}
			}
		});
//});